package com.lagou.edu;

import com.alibaba.druid.pool.DruidDataSource;
import com.lagou.edu.annotation.MyService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.*;

import javax.sql.DataSource;

/**
 * @author 应癫
 */

public class SpringConfig {

    public String driverClassName = "com.mysql.cj.jdbc.Driver";
    public String url = "jdbc:mysql://localhost:3306/bank?useSSL=true&serverTimezone=UTC";
    public String username = "root";
    public String password = "Fuckyou@2019";

    public DataSource createDataSource(){
        DruidDataSource druidDataSource = new DruidDataSource();
        druidDataSource.setDriverClassName(driverClassName);
        druidDataSource.setUrl(url);
        druidDataSource.setUsername(username);
        druidDataSource.setPassword(password);
        return  druidDataSource;
    }
}
